package com.jy.rhin.model;

import com.jy.rhin.infra.cda.EDataElement;
import com.jy.rhin.infra.cda.XPath;
import com.jy.rhin.infra.cda.XValid;
import com.jy.rhin.model.body.feiyong.FeiYong;
import com.jy.rhin.model.body.shiyanshijiancha.ShiYanShiJCJY;
import com.jy.rhin.model.body.shoushucaozuo.ShouShu;
import com.jy.rhin.model.body.yongyao.YongYao;
import com.jy.rhin.model.body.zhenduanjilu.MenZhenZD;
import com.jy.rhin.model.body.zhengzhuang.ZhengZhuang;
import com.jy.rhin.model.body.zhiliaojihua.ZhiLiaoJH;
import com.jy.rhin.model.body.zhuanzhenjianyi.ZhuanZhenJY;
import com.jy.rhin.model.body.zhuyaojiankangwenti.ZhuYaoJKWT;
import com.jy.rhin.model.header.ComponentOf;
import com.jy.rhin.parse.ItemSTSelector;
import com.jy.rhin.parse.ItemTextSelector;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * @Author 姚俊
 * @Date 2023/2/7 14:44
 * @Description 门诊摘要
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class MenZhenZY extends ClinicalDocumentData {

    //文档唯一id
    @XPath(path = "/id/@extension"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE01_00_008_00))
    String id;

    @XPath(path = "/componentOf")
    ComponentOf componentOf;
    @XPath(path = "/component/structuredBody/component/section/code[@code='11450-4'][@codeSystem='2.16.840.1.113883.6.1']/..")
    //主要健康问题
    ZhuYaoJKWT zhuYaoJKWT;
    //症状列表
    @XPath(path = "/component/structuredBody/component/section/code[@codeSystem='2.16.840.1.113883.6.1'][@displayName='症状章节']/.."
            , listItemPath = "/entry/organizer/component/observation/code[@code='DE04.01.118.00'][@codeSystem='2.16.156.10011.2.2.1']")
    List<ZhengZhuang> zhengZhuangList;
    //实验室检验检查列表
    @XPath(path = "/component/structuredBody/component/section/code[@code='30954-2'][@codeSystem='2.16.840.1.113883.6.1']/.."
            , listItemPath = "/entry/organizer/component/observation/code[@code='DE04.30.015.04'][@codeSystem='2.16.156.10011.2.2.1']")
    List<ShiYanShiJCJY> shiYanShiJCJYList;
    //诊断
    @XPath(path = "/component/structuredBody/component/section/code[@code='29548-5'][@codeSystem='2.16.840.1.113883.6.1']/.."
            , listItemPath = "/entry/organizer/component/observation/code[@code='DE05.01.025.00'][@codeSystem='2.16.156.10011.2.2.1']")
    List<MenZhenZD> zhenDuanList;
    //用药
    @XPath(path = "/component/structuredBody/component/section/code[@code='10160-0'][@codeSystem='2.16.840.1.113883.6.1']/..")
    List<YongYao> yongYao;
    //手术
    @XPath(path = "/component/structuredBody/component/section/code[@code='47519-4'][@codeSystem='2.16.840.1.113883.6.1']/.."
            , listItemPath = "/entry/procedure", listItemBackLevel = 0)
    List<ShouShu> shouShuList;
    //其他医学处置
    @XPath(path = "/component/structuredBody"
            , listItemPath = "/component/section/code[@code='DE06.00.087.00']/.."
            , listItemBackLevel = 0
            , itemParser = ItemTextSelector.class
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE06_00_087_00, nullable = true))
    List<String> qiTaYXCZList;
    //转诊建议
    @XPath(path = "/component/structuredBody/component/section/code[@code='18776-1'][@codeSystem='2.16.840.1.113883.6.1']/..")
    ZhuanZhenJY zhuanZhenJY;
    //健康评估
    @XPath(path = "/component/structuredBody/component/section/code[@code='51848-0'][@codeSystem='2.16.840.1.113883.6.1']/../entry/observation/value/text()"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE05_10_033_00, nullable = true))
    String jianKangPG;
    //治疗计划
    @XPath(path = "/component/structuredBody/component/section/code[@code='18776-5'][@codeSystem='2.16.840.1.113883.6.1']/..")
    ZhiLiaoJH zhiLiaoJH;
    //健康指导
    @XPath(path = "/component/structuredBody/component/section/code[@code='69730-0'][@codeSystem='2.16.840.1.113883.6.1']/.."
            , listItemPath = "/entry/observation/code[@code='DE06.00.066.00'][@codeSystem='2.16.156.10011.2.2.1']"
            , listItemBackLevel = 1
            , itemParser = ItemSTSelector.class
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE06_00_066_00, nullable = true))
    List<String> jianKangZDList;
    //费用
    @XPath(path = "/component/structuredBody"
            , listItemPath = "/component/section/code[@code='48768-6'][@codeSystem='2.16.840.1.113883.6.1']"
            , listItemBackLevel = 1)
    List<FeiYong> feiYongList;
}
